﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GH.BLL;
using System.Data;

namespace GH.Web.UionReport
{
    public partial class LegalAidPrint : BasePage.PageBase
    {
        public string mstrUnionName = string.Empty;
        public static string UnitRoot = System.Configuration.ConfigurationSettings.AppSettings["UnitRoot"];

        public DataSet dsRecord;
        protected void Page_Load(object sender, EventArgs e)
        {
            GH.BLL.Union bllUnion = new Union();
            if (!this.IsPostBack)
            {

                this.Session["UnionSelect"] = this.Session["Union"].ToString();

                //当前日期
                Session["SelectCurrentYear"] = System.DateTime.Now.Year.ToString();

                GH.Model.工会单位信息 modUnion = bllUnion.GetModel(int.Parse(this.Session["UnionSelect"].ToString()));
                mstrUnionName = modUnion.单位名称;

                lblCurrentYea1.Text = System.DateTime.Now.Year.ToString();
                lblCurrentYear2.Text = System.DateTime.Now.Year.ToString();
                lblUnionName1.Text = modUnion.单位名称;
                lblUnionName2.Text = modUnion.单位名称;

                GH.BLL.LegalAid bllLegalAid = new GH.BLL.LegalAid();
                string strWhere = "  1=1";
                if (Request["RightsFlg"].ToString() == "Summary")
                {
                    lblUnionName1.Text = UnitRoot;
                    lblUnionName2.Text = UnitRoot;
                    strWhere += " AND  工会年度法律援助统计表.年份='" + Session["SelectCurrentYear"].ToString() + "'";
                    dsRecord = bllLegalAid.GetListSum(strWhere);
                }
                else if (Request["RightsFlg"].ToString() == "SELECT")
                {
                    lblUnionName1.Text = modUnion.单位名称;
                    lblUnionName2.Text = modUnion.单位名称;
                    strWhere += " AND  工会年度法律援助统计表.单位=" + this.Session["UnionSelect"].ToString();
                    strWhere += " AND  工会年度法律援助统计表.年份='" + Session["SelectCurrentYear"].ToString() + "'";
                    dsRecord = bllLegalAid.GetList(strWhere);
                }

            }
        }
    }
}
